package com.supermarket.manage.common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.supermarket.manage.common.validation.CheckGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 供应商实体类
 *
 * @author: Faxon
 * @data: 2020/3/13
 */
@Data
@ApiModel(value = "Supplier:供应商实体类")
@TableName("tb_supplier")
public class Supplier implements Serializable {

    private static final long serialVersionUID = -1579601602102509449L;
    /**
     * 供应商id
     */
    @ApiModelProperty(value = "供应商id")
    @TableId(type = IdType.ASSIGN_UUID)
    @NotBlank(message = "供应商id不能为空", groups = {CheckGroup.Update.class})
    private String sid;

    /**
     * 供应商名称
     */
    @ApiModelProperty(value = "供应商名称")
    @NotBlank(message = "供应商名称不能为空", groups = {CheckGroup.Add.class, CheckGroup.Update.class})
    private String sname;

    /**
     * 供应商电话
     */
    @ApiModelProperty(value = "供应商电话")
    @NotBlank(message = "供应商电话不能为空", groups = {CheckGroup.Add.class, CheckGroup.Update.class})
    private String sphone;

    /**
     * 供应商地址
     */
    @ApiModelProperty(value = "供应商地址")
    @NotBlank(message = "供应商地址不能为空", groups = {CheckGroup.Add.class, CheckGroup.Update.class})
    private String adress;

    /**
     * 状态（0正常，1删除）
     */
    @ApiModelProperty(value = "状态（0正常，1删除）")
    private Integer status;

    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
    @NotBlank(message = "客户id不能为空", groups = {CheckGroup.Add.class, CheckGroup.Get.class})
    private String buyerId;

    /**
     * 添加时间
     */
    @ApiModelProperty(value = "添加时间")
    private Date created;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    private Date updated;
}
